package com.flink.streaming.web.service;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.flink.streaming.web.model.entity.AzkanbanOfflineSQL;
import com.flink.streaming.web.model.param.AzKaBanParam;
import com.flink.streaming.web.model.param.AzKaBanRunParam;
import com.flink.streaming.web.model.vo.AzkanbanOfflineSQLVO;
import com.github.pagehelper.Page;

import java.util.List;
import java.util.Map;

public interface AzKaBanSqlService {

    /**
     * 提交离线sql
     * @param offlineSQL 入参
     * @param userName 入参
     */
    void submitSql(AzkanbanOfflineSQL offlineSQL, String userName) throws Exception;

    /**
     * 分页
     * @param azKaBanParam 入参
     * @return 返回值
     */
    Page<AzkanbanOfflineSQLVO> listPage(AzKaBanParam azKaBanParam);

    /**
     * 查询详情
     * @param id id
     * @return 返回值
     */
    AzkanbanOfflineSQLVO queryById(Long id);

    /**
     * 修改
     * @param offlineSQL 入参
     * @param userName 入参
     */
    void editSql(AzkanbanOfflineSQL offlineSQL, String userName) throws Exception;

    /**
     * 修改装据
     * @param id 入参
     * @param userName 入参
     */
    void updateStatus(Long id, String userName) throws Exception;

    /**
     * 执行
     * @param param 入参
     */
    List<String> runSql(AzKaBanRunParam param) throws Exception;

    /**
     * 获取log
     * @param dataJson 入参
     * @return 返回值
     */
    Map<String, JSONObject> queryFlowLog(JSONArray dataJson) throws Exception;
}
